# -*- coding: utf-8 -*-

from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.http import HttpResponseNotFound

from django.template import RequestContext
from django.template.loader import get_template

from django.contrib.auth import get_user
from django.contrib.auth.decorators import login_required

from handle import _handle_place_query
from handle import _handle_search_place

def place(request, keyword, index):
    """
    Serve people's request for searching for place
    """
    if request.method == 'POST':
        return HttpResponseNotFound({}, mimetype='application/json')
    else:
        results = _handle_place_query(request, keyword, index)

        return HttpResponse(results, mimetype='application/json')
